<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <title>v-text & v-html 案例</title>
</head>
<body>
    <h1>v-text & v-html 案例</h1>
    <hr>
    <div id="app">
       <p>{{message}}</p>
       <p v-text="message"></p>
       <p v-html="messhtml"></p><!--会引起xss攻击，特别用户提交表单时尤其注意-->
    </div>
 
    <script type="text/javascript">
        var app=new Vue({
            el:'#app',
            data:{
                message:'heheda',
                messhtml:'<span style="color:red;">html</span>'
            }
        });
    </script>
</body>
</html>